/*
 * Copyright 2008. Mount Sinai Hospital, Toronto, Canada.
 * 
 * Licensed under the Apache License, Version 2.0. You
 * can find a copy of the license at:
 * 
 * http://www.apache.org/licenses/LICENSE-2.0
 * 
 * IN NO EVENT SHALL MOUNT SINAI HOSPITAL BE LIABLE TO ANY PARTY FOR DIRECT, 
 * INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST 
 * PROFITS, ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, 
 * EVEN IF MOUNT SINAI HOSPITAL HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH 
 * DAMAGE.
 * 
 * MOUNT SINAI HOSPITAL SPECIFICALLY DISCLAIMS ANY IMPLIED WARRANTIES OF 
 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE AND 
 * ACCOMPANYING DOCUMENTATION, IF ANY, PROVIDED HEREUNDER IS PROVIDED "AS IS". 
 * MOUNT SINAI HOSPITAL HAS NO OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, 
 * UPDATES, ENHANCEMENTS, OR MODIFICATIONS. 
 */

package com.sinai.mshab.data.core;

import com.google.gwt.user.client.ui.Widget;

/**
 * A {@code DataManagerCollection} contains a number of {@link DataManager}s
 * and can return an appropriate {@code DataManager} for specific {@link Widget}s.
 * 
 * @author Arthur Kalmenson
 */
public interface DataManagerCollection {

	/**
	 * Returns true if there is a {@link DataManager} for the given
	 * {@link Widget} and false otherwise.
	 * 
	 * @param widget
	 *            the {@code Widget} to check.
	 * @return true if there is a {@code DataManager} for the given
	 *         {@code Widget} and false otherwise.
	 */
	public boolean hasDataManager(Widget widget);

	/**
	 * Returns the {@link DataManager} that is associated with {@code widget}.
	 * 
	 * @param widget
	 *            the {@link Widget} who's {@code DataManager} we want.
	 * @return the {@code DataManager} that is associated with {@code widget}.
	 */
	public DataManager<?, ?> getDataManager(Widget widget);
}
